<%--
  Created by IntelliJ IDEA.
  User: zhongwei
  Date: 2014/5/14
  Time: 13:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
    <base href="<%=basePath%>"></base>
    <title>舆情主题配置中心</title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="css/mainPageStyle.css"/>
    <link rel="stylesheet" href="css/pagination.css"/>
    <link rel="stylesheet" href="css/subPage.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.pagination.js"></script>
    <%@include file="../im.jsp" %>
</head>


<body>
<logic:notEmpty name="user">

    <div id="content" class="container">
        <%@include file="../top.jsp" %>
        <div class="row">
            <%@include file="../left.jsp" %>


            <div class="col-md-10" style="padding: 15px">
                <div>
                    <h3>已监控如下主题：</h3>

                    <logic:present name="result" scope="request">
                        <table class="table table-hover">

                            <logic:iterate id="record" name="result">

                                <tr valign="top">
                                    <td valign="top" style="font-size:14px;padding-top:5px;">

                                        <bean:write name="record" property="name"/>
                                    </td>
                                    <td>
                                        <bean:write name="record" property="description"/>&nbsp;&nbsp;&nbsp;
                                    </td>

                                    <td>
                                        <bean:write name="record" property="keywords"/>&nbsp;&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        <bean:write name="record" property="excludeWords"/>&nbsp;&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        <html:link page="/topicAction.do?method=edit" paramId="topicId" paramName="record"
                                                   paramProperty="id">编辑</html:link>
                                    </td>
                                    <td>
                                        <html:link page="/topicAction.do?method=delete" paramId="topicId" paramName="record"
                                                   paramProperty="id">删除</html:link>
                                    </td>

                                    <td>
                                        <logic:equal name="record"
                                                     property="id" value='${sessionScope.topicId}'>
                                            当前主题
                                        </logic:equal>
                                        <logic:notEqual value='${sessionScope.topicId}' name="record"
                                                        property="id">
                                            <html:link page="/topicAction.do?method=addtopic2user" paramId="topicId"
                                                       paramName="record" paramProperty="id">设置为我的主题</html:link>
                                        </logic:notEqual>
                                    </td>
                                </tr>

                            </logic:iterate>
                        </table>
                    </logic:present>
                    <html:link page="/site/addtopic.jsp">添加主题</html:link>
                </div>
            </div>
        </div>
    </div>
</logic:notEmpty>
<logic:empty name="user">
    Access Rejected! Error 404
</logic:empty>
</body>
</html>


